package com.lili.goods.service.impl;

import com.lili.goods.mapper.GoodsBrandMapper;
import com.lili.goods.service.GoodsBrandService;
import com.lili.model.goods.GoodsBrand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsBrandServiceImpl implements GoodsBrandService {

    @Autowired
    GoodsBrandMapper goodsBrandMapper;

    @Override
    public List<GoodsBrand> getBrand() {
        return goodsBrandMapper.selectList(null);
    }

    @Override
    public int saveBrand(GoodsBrand goodsBrand) {
        return goodsBrandMapper.insert(goodsBrand);

    }

    @Override
    public int updateBrand(GoodsBrand goodsBrand) {
        return goodsBrandMapper.updateById(goodsBrand);
    }

    @Override
    public int deleteBrand(GoodsBrand goodsBrand) {
        return goodsBrandMapper.deleteById(goodsBrand);
    }
}
